import axios from 'axios'
import { shopsUrl,cardUrl } from '../../baseUrl/index'
import QS from 'axios'
let state = {}

let mutations = {}

let actions = {
    submitOrder(context,obj) {
        return new Promise(function (resolve, reject) {
            axios({
                url: cardUrl,
                method: 'post',
                data: obj
            })
            .then(data => {
                resolve(data)
            })
        })
    },
    getShopsData() {
        return new Promise(function (resolve, reject) {
            axios({
                url: shopsUrl,
                method: 'get',
                params: {
                    transform: 1
                }
            })
            .then((data) => {
                resolve(data.data.records)
            })
        })
    }
}

export default {
    namespaced: true,
    state,
    mutations,
    actions
}